package com.SoilMM.service.impl;

import com.SoilMM.entity.AdminEntity;
import com.SoilMM.mapper.AdminMapper;
import com.SoilMM.service.AdminService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Gramorgan
 * @since 2021-07-04
 */
@Service
public class AdminServiceImpl extends ServiceImpl<AdminMapper, AdminEntity> implements AdminService {

    @Override
    public boolean doLogin(AdminEntity adminEntity) {
        QueryWrapper<AdminEntity> wrapper=new QueryWrapper<>();
        wrapper.eq("user_name",adminEntity.getUserName());
        wrapper.eq("pass_word",adminEntity.getPassWord());

        AdminEntity adminEntity1=baseMapper.selectOne(wrapper);
        if (adminEntity1!=null)
            return true;
        else
            return false;
    }
}
